package block;

import java.awt.Rectangle;
import java.lang.Math;

/*
 * This class defines a player shot.
*/
public class pShot {

	private int x; // x location
	private int y; // y location
	private int width; // width of shot
	private int height; // height of shot
	private boolean visible; // is visible (on screen) or not

  // Our constructor. Input variables are x and y coordinates.
	public pShot(int sx, int sy) {
		x = sx;
		y = sy;
		visible = true;
		width = 10;
		height = 10;
	}

  // The following methods return the various properties of a shot.
	public int getX() {
		return x;
	}
	
	public int getY() {
		return y;
	}
	
	public int getWidth() {
		return width;
	}
	
	public int getHeight() {
		return height;
	}
	
	public boolean isVisible() {
		return visible;
	}
	
  // Sets the visibility of the shot. 
	public void setVisible(boolean v) {
		visible = v;
	}
	
  // Moves the shot downward. Remember that moving up requires
  // a negative number since y = 0 is at the top of the screen.
  // Since the shots move upward, we decriment their position.
	public void move() {
		y -= 1;
	}
	
  // Returns a rectangle for use in collisions. 
	public Rectangle getBounds() {
		return new Rectangle(x,y, width, height);
	}
		
}
